package cn.thornbird.orgsync.service;

import cn.thornbird.orgsync.entity.User;
import cn.thornbird.orgsync.entity.status.VerificationCodeUsage;
import cn.thornbird.orgsync.exception.BadRequestException;
import cn.thornbird.orgsync.exception.NotFoundException;
import cn.thornbird.orgsync.model.PageList;
import cn.thornbird.orgsync.model.UserData;
import cn.thornbird.orgsync.vo.request.ChangePasswordRequest;
import cn.thornbird.orgsync.vo.record.SimpleUserRecord;
import cn.thornbird.orgsync.vo.request.ResetPasswordRequest;
import cn.thornbird.orgsync.vo.request.SignUpRequest;
import cn.thornbird.orgsync.vo.request.UserQueryRequest;
import cn.thornbird.orgsync.vo.record.UserRecord;

import java.util.Date;
import java.util.List;

public interface UserService {

    User find(String id) throws NotFoundException;

    User findByMobile(String mobile);

    User findByMobileOrUsername(String value);

    List<User> findUsers(List<String> ids);

    PageList<User> query(UserQueryRequest userQueryRequest, Integer pageNumber, Integer pageSize);

    List<User> query(String keyword, Integer maxSize);

    User save(UserRecord userRecord) throws BadRequestException, NotFoundException;

    User delete(String id) throws NotFoundException;

    UserData currentUser(UserData userData, List<User> list);

    User updateUserInfo(String id, SimpleUserRecord userRecord) throws BadRequestException, NotFoundException;

    Date changePassword(String id, ChangePasswordRequest changePasswordRequest)
            throws BadRequestException, NotFoundException;

    Boolean sendVerificationCode(String mobile, VerificationCodeUsage usage);

    String findVerificationCode(String mobile, String code, VerificationCodeUsage usage);

    User signUp(SignUpRequest signUpRequest) throws BadRequestException, NotFoundException;

    User resetPassword(ResetPasswordRequest resetPasswordRequest) throws BadRequestException, NotFoundException;

}
